package com.oscroll.strategy.lesson.pay;

public class Order {

    private Payment payment;

    public Order(){
        this.payment = new AliPay();
    }
    // 为什么不用payment,接口来代替
    public PayState pay(PayType payType) {
        return payType.get().pay();
    }

    public Order setPayment(Payment payment){
        this.payment = payment;
        return this;
    }

    public PayState pay2() {
        return payment.pay();
    }
}
